<%@ codepage=65001%>
<%if session("login")<>"ok" then%>
<script language="JavaScript">

//alert("")
location.href="login.asp"
</script>
<%
response.End
end if%>
<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>网点查询地图系统</title>
<link rel="stylesheet" type="text/css" href="ext/ext-3.3.1/resources/css/ext-all.css"/>
<script type="text/javascript" src="ext/ext-3.3.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext/ext-3.3.1/ext-all.js"></script>
<script type="text/javascript" src="citys/tree.js"></script>
<script type="text/javascript" src="citys/tree_checked.js"></script>
<script language="javascript" src="http://api.51ditu.com/js/maps.js"></script>
<script language="javascript" src="http://api.51ditu.com/js/ezmarker.js"></script>
<script type="text/javascript" src="http://api.51ditu.com/js/bus.js"></script>
<script language="javascript" src="http://api.51ditu.com/js/navigate.js"></script>
<style type="text/css">v\:*{behavior:url(#default#VML);}</style>
<style type="text/css">
.zhandian01 {background-image: url("icons/bus/zhandian01.gif");background-position: left top;background-repeat: no-repeat;display: inline;float: left;height: 28px;margin: 0 auto;}

.zhandian02 {background-image: url("icons/bus/zhandian02.gif");background-position: center top;background-repeat: repeat-x;border-right: 1px solid #666666;display: inline;float: left;line-height: 21px;margin: 0 5px 0 14px;padding-right: 4px;
}
</style>
<script type="text/javascript">
Ext.BLANK_IMAGE_URL = 'ext/ext-3.3.1/resources/images/default/s.gif';
var maps;
//var areaColor = "";
var pageSize = 50;	//每页显示的最大值

Ext.onReady(function(){
	maps = new LTMaps( "myMap" );
	maps.centerAndZoom(new LTPoint(10444800,3514368),13);	//定位全国
	var standMapControl = new LTStandMapControl();
	maps.addControl(standMapControl);
	maps.handleMouseScroll(true);//启用鼠标滚轮功能支持,参数true代表使用鼠标指向点位置不变模式
	control=new LTPolyLineControl();//增加测距控件
	control.setTips("双击结束");//改变操作提示文字内容
	LTEvent.bind(maps,"dblclick",control,control.endDraw);//在双击地图的时候调用结束操作
	maps.addControl(control);
	controlm=new LTPolygonControl();
	controlm.setTips("双击结束");//改变操作提示文字内容
	LTEvent.bind(maps,"dblclick",controlm,controlm.endDraw);//在双击地图的时候调用结束操作
	maps.addControl(controlm);
	control.setVisible(false);
	controlm.setVisible(false);
	
    // 布局开始
    var viewport = new Ext.Viewport({
        layout:'border',
        items:[{
            region: 'north',
            contentEl: 'north-div',
            height: 55,
            bodyStyle: 'background-color:#BBCCEE;'
        },{
			region:'center',
			xtype:'panel',
			title:'地图',
			tbar:[
				{text:'放大',handler:function(){maps.zoomIn();}},
				{text:'缩小',handler:function(){maps.zoomOut()}},
				{text:'测距',handler:function(){control.btnClick();}},
				{text:'测面',handler:function(){controlm.btnClick();}},
				{text:'打印',handler:function(){printMap(maps)}},
				{text:'清空地图',handler:function(){maps.clearOverLays();}}
			],
			//bbar:[{text:'全部网点显示',handler:function(){maps.clearOverLays();
//				customerJsonStore.removeAll();
//				customerJsonStore.load({params: {start:0,limit:pageSize,citycode:"",type:"init"},callback:function(r,options,success){if(ds.getCount() == 0){Ext.MessageBox.alert('提示', "搜索无结果");}}});
//					//加载JSON数据给地图对象
//					ds.addListener('load', function(st, rds, opts){
//						if(maps)
//						{
//							maps.clearOverLays();
//						}
//					});
//				}
//			}],
			tools:[{id:""}],
			listeners:{"bodyresize":function(){if(typeof(maps)=="object"){maps.resizeMapDiv();}}},//监控地图大小改变后,地图自适应
			contentEl:'myMap'
			
			
			
			/*,
			collapsible:true,
            split: true,
            border: true,
            //layout: 'border',
			layout: 'accordion',
			layoutConfig:{
				titleCollapse:true,
				animate:true
				//,
				//activeOnTop:false
			},
			width:250,
            items: [formRoadSearch,grid]*/
		}
		,{
            region: 'south',
            contentEl: 'south-div',
            height: 200,
            bodyStyle: 'background-color:#BBCCEE;',
			id:"southID"
			
			,
			collapsible:true,
			//collapsed:true,
            //split: true,
            border: true,
			/*layout: 'accordion',
			layoutConfig:{
				titleCollapse:true,
				animate:true,
				activeOnTop:false
			},*/
			//width:250,
            items: [grid]
        }
		,{
            //region: 'east',
			region: 'west',
			collapsible:true,
            split: true,
            border: true,
            //layout: 'border',
			layout: 'accordion',
			layoutConfig:{
				titleCollapse:true,
				animate:true,
				activeOnTop:false
			},
			width:250,
            items: [formRoadSearch]
        }
		]
    });
    // 布局结束
	//地图打印
	function printMap(maps)
	{
		var html = "<!DOCTYPE HTML\">\n";
		html += (document.all)?"<html xmlns:v=\"urn:schemeas-microsoft-com:vml\">":"<html>";
		html += "\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\n<title>Print Maps<\/title>\n";
		html += "<style type=\"text\/css\">\nbody {margin: 0px;}\n";
		html += (document.all)?"v\\:*{ Behavior:url(#default#VML);}":"";
		html += "\n</style>\n";
		html += "<\/head>\n";
		html += "<body><right>\n";
		html += maps.getMapContent(0);//改变"0"这个参数，可以将地图之中的标注也打印到地图，具体请参照类参考文档之中的getMapContent说明
		html += "\n<\/right><\/body>\n<\/html>";
		var win = window.open("about:blank","win","menubar=1,width="+(maps.container.offsetWidth)+",height="+(maps.container.offsetHeight-20));
		win.document.writeln(html);
		win.moveTo(0,0);
		win.print();
		win.document.close();	
		win.close();
	}
	//Ext.fly(Ext.get('treeCitysSearch')).setHeight(parseInt(document.body.clientHeight)-122-108,true)
	//treeCitysSearch.setHeight(parseInt(document.body.clientHeight)-122-117);
	
	var south = Ext.getCmp('southID');  
	//alert(south);
    south.collapse();
});

Ext.EventManager.onWindowResize(function(width,height){//改变窗口的时候会提示出窗口的宽高
	//treeCitysSearch.setHeight(parseInt(height)-122-117);
});

//-----------------------------------------行程信息查询开始-----------------------------------------------


var roadJsonStore = new Ext.data.JsonStore({
	url: "json_roadInfoSearch_client.asp",
	root: "root",
	totalProperty: 'mytotal',
	//remoteSort:true,
	baseParams:{start:0,limit:pageSize},
	idProperty: "id",
	//fields: ["id", "name", "info","icon","lag","lat","file1"]
	fields: ["id","roadTitle","lng","lat","roadDate","roadTarget","cityName"]
});

//行程信息查询列表
var roadList = new Ext.grid.ColumnModel([
	{header:'编号',dataIndex:'id'},
	{header:'标题',dataIndex:'roadTitle'},
	{header:'起点经度',dataIndex:'lng'}
	,
	{header:'起点纬度',dataIndex:'lat'},
	{header:'日期',dataIndex:'roadDate'},
	{header:'访问客户或网点',dataIndex:'roadTarget'},
	{header:'客户或网点所属客户',dataIndex:'cityName'},
	{
		header:'公交',
		dataIndex:'gongjiao',
		width:60,
		renderer:gongJiaoFun
	},
	{
		header:'导航',
		dataIndex:'daoHang',
		width:60,
		renderer:daoHangFun
	}
	/*,
	{
		header:'清除',
		dataIndex:'qingChu',
		width:60,
		renderer:shanChuFun
	}*/
]);

var grid = new Ext.grid.GridPanel({
	store:roadJsonStore,
	cm: roadList,
	loadMask: true,
	//closable: true,
	frame:true,
	enableTabScroll: true,
	//title: '信息列表',
	height:180,
	bbar: new Ext.PagingToolbar({
		pageSize:pageSize,
		store:roadJsonStore,
		displayInfo:true,
		displayMsg:'显示第{0}条到{1}条记录,一共{2}条',
		//item:null,
		emptyMsg:'没有记录'
	})
});


//行程信息查询
var formRoadSearch = new Ext.form.FormPanel({
	id: 'formRoadSearchID',
	name: 'formRoadSearchID',
	title: '行程信息查询',
	autoHeight: true,
	frame: true,
	layout: "form", // 整个大的表单是form布局
	labelWidth: 60,
	labelAlign: "right",
	items: [
		//类别选取择强束
		{
			xtype: 'textfield',
			name:'roadKeyWord',
			id:'roadKeyWord',
			fieldLabel: '关键词'
			,
			//anchor: '100%',
			width:150
		}
	],
	buttons: [{
		text: '查询',
		handler:function(){
			//grid.getBottomToolbar().bind(roadJsonStore);//重新绑定分页
			//grid.reconfigure(roadJsonStore,roadList);	//更换显示的数据
			roadJsonStore.removeAll();
			maps.clearOverLays();
			grid.expand();
			
			var south = Ext.getCmp('southID');  
			//alert(south);
			south.expand();
			
			roadJsonStore.on('beforeload',function(){
				Ext.apply(
				this.baseParams,
				{
					roadKeyWord:Ext.getCmp("roadKeyWord").getValue()
				});
			});
			roadJsonStore.load({
				params: {
					start:0,
					limit:pageSize,
					roadKeyWord:Ext.getCmp("roadKeyWord").getValue()
				}
				,callback:function(r,options,success){if(roadJsonStore.getCount() == 0){Ext.MessageBox.alert('提示', "搜索无结果");}}
			})
		}
	}]
});

//公交按钮
function gongJiaoFun(value,cellmeta,record,rowIndex,columnIndex,store)
{
	var str="<input type='button' value='公交' onclick='gongJiaoFunDo(\""+escape(record.data["id"])+"\",\""+escape(record.data["roadTitle"])+"\",\""+escape(record.data["lng"])+"\",\""+escape(record.data["lat"])+"\",\""+escape(record.data["roadDate"])+"\",\""+escape(record.data["roadTarget"])+"\",\""+escape(record.data["cityName"])+"\")'\>"
	//alert(str);
	return str;
}

//全局变量
var map, //51ditu的Map对象
bus, //公交接口变量
routeResult, //公交换乘方案结果
spoint, //公交换乘方案的起始坐标点
epoint, //公交换乘方案的目标坐标点
iconUrl = 'http:\/\/api.51ditu.com\/img\/bus\/point1.gif'; //自定义图片路径

//----------------------公交查询开始------------------------------------
function gongJiaoFunDo(id,roadTitle,lng,lat,roadDate,roadTarget,cityName)
{
	//alert(cityName);
	var self = this;
	//alert(unescape(cityName));
	Ext.Ajax.request({
		url:'json_gongJiaoSearch.asp',
		method:'post',
		params:{
			roadTarget:roadTarget
		},
		success:function(req){
			//alert(req.responseText);
			maps.clearOverLays();
			var obj = req.responseText;
			if(obj.indexOf("|") != -1)
			{
				var objArr = obj.split("|");
				
				var slnglat = new LTPoint(parseInt(lng),parseInt(lat));
				spoint = slnglat
				var elnglat = objArr[0].split(",");
				epoint = new LTPoint(parseInt(elnglat[0]),parseInt(elnglat[1]));
				//alert(slnglat.getLongitude()+","+slnglat.getLatitude()+"|===|"+epoint.getLongitude()+","+epoint.getLatitude());
				bus = new LTBus(); //新建一个公交接口对象
				bus.setCity(unescape(cityName)); //设置公交所在城市
				LTEvent.addListener(bus,'routesloaded',function(result){
					routeResult = result;
					if(routeResult.routes)
					{
						var route = routeResult.routes[0];
						bus.getRouteDetail(route); //通过换乘方案对象获取此换乘方案的详细信息参数类型为LTBusRoute
					}
					else
					{
						alert("无公交");
					}
				}); //绑定公交换乘方案信息加载后，调用routesLoaded函数
				LTEvent.addListener(bus,"routedetailloaded",onRouteDetailLoadedBus);
				bus.getRoutesByPoint(slnglat,epoint);//根据起始坐标点/站点，获取换乘方案
				
				for(var i=0;i<objArr.length;i++)
				{
					if((i+1)<objArr.length)
					{
						var slnglat = objArr[i].split(",");
						var elnglat = objArr[i+1].split(",");
						if(slnglat.length === 1){//判断是坐标点还是站点名称
							spoint = slnglat[0];
						}else{
							spoint = new LTPoint(slnglat[0],slnglat[1]);
						}
						if(elnglat.length === 1){//判断是坐标点还是站点名称
							epoint = elnglat[0];
						}else{
							epoint = new LTPoint(elnglat[0],elnglat[1]);
						}
						//alert(slnglat[0]+","+slnglat[1]+"||"+elnglat[0]+","+elnglat[1]);
						bus = new LTBus(); //新建一个公交接口对象
						bus.setCity(unescape(cityName)); //设置公交所在城市
						LTEvent.addListener(bus,'routesloaded',routesLoadedBus); //绑定公交换乘方案信息加载后，调用routesLoaded函数
						LTEvent.addListener(bus,"routedetailloaded",onRouteDetailLoadedBus);
						bus.getRoutesByPoint(spoint,epoint);//根据起始坐标点/站点，获取换乘方案
					}
				}
			}
			else
			{
				var elnglat = obj.split(",");
				spoint = new LTPoint(lng,lat);
				if(elnglat.length === 1){//判断是坐标点还是站点名称
					epoint = elnglat[0];
				}else{
					epoint = new LTPoint(elnglat[0],elnglat[1]);
				}
				bus = new LTBus(); //新建一个公交接口对象
				bus.setCity(unescape(cityName)); //设置公交所在城市
				LTEvent.addListener(bus,'routesloaded',routesLoadedBus); //绑定公交换乘方案信息加载后，调用routesLoaded函数
				LTEvent.addListener(bus,"routedetailloaded",onRouteDetailLoadedBus);
				bus.getRoutesByPoint(spoint,epoint);//根据起始坐标点/站点，获取换乘方案
			}
		}
	});
}

function routesLoadedBus(result)
{
	routeResult = result;
	if(routeResult.routes)
	{
		var route = routeResult.routes[0];
		bus.getRouteDetail(route); //通过换乘方案对象获取此换乘方案的详细信息参数类型为LTBusRoute
	}
	else
	{
		alert("无公交");
	}
}

//在获取到点的详细信息时执行的操作
function onRouteDetailLoadedBus(routes)
{
	//alert(routes);
	drawRouteBus(routes); //显示换乘方案
	//showStartAndEndBus(); //在地图上显示起点坐标和终点坐标
}
//在地图上显示换乘轨迹
function drawRouteBus(routes)
{
	//alert("return="+routes.routeLines.length);
	//maps.clearOverLays();
	var totalPoint = []; //此换乘方案的所有坐标点
	var colors = ['green','blue','red'];
	var sePoint = [];//当前请求线路步行的起始点集合
	sePoint.push(spoint); //把此换乘起始坐标点放入数组
	for(var i = 0;i < routes.routeLines.length; i++){
		var routeLine = routes.routeLines[i];
		sePoint.push(routeLine.sStation.point); //把换乘中的公交线路的起始坐标点放入数组
		sePoint.push(routeLine.eStation.point); //把换乘中的公交线路的终点坐标点放入数组
		for(var j = 0; j<routeLine.stations.length; j++){
			//在地图上显示所有的公交站点名称
			maps.addOverLay(createMarker(routeLine.stations[j].point,routeLine.stations[j].name));
			//显示经过站点的自定义图标
			maps.addOverLay(createIcon(routeLine.stations[j].point));
			
			totalPoint.push(routeLine.stations[j].point)
		}
		maps.addOverLay(new LTPolyLine(routeLine.points,'blue')); //在地图上显示公交线路轨迹
	}
	sePoint.push(epoint);  //把此换乘最终坐标点放入数组
	//drawWalk(sePoint);
	//maps.getBestMap(totalPoint);
}
//显示起点和终点的位置
function showStartAndEndBus()
{
	//起点
	maps.addOverLay(createSpecialText(spoint,'起点'));
	maps.addOverLay(createIcon(spoint));
	
	//终点
	maps.addOverLay(createSpecialText(epoint,'终点'));
	maps.addOverLay(createIcon(epoint));
}
//创建起点终点的特殊样式
function createSpecialText(point,txt)
{
	var maptxt = new LTMapText(point,[-5,-20]);
	maptxt.setLabel(txt);
	maptxt.setBackgroundColor("green");//更改文字标签背景色
	maptxt.setFontColor("#fff"); 		//更改文字字体颜色
	return maptxt;
}
//显示出需要步行的路段轨迹
function drawWalk(sePoint)
{
	while(sePoint.length>0){
		//把所有起始点重新组合，把上一线路的终点或者换乘的起始点作为步行路段的起点，下一线路的起始点或者目的地作为步行路段终点
		var a = sePoint.splice(0,2); 
		//alert(a.getLongitude()+"||||"+a.getLatitude());
		maps.addOverLay(new LTPolyLine(a,'green'));//显示步行路段的轨迹
	}
}
//显示站点坐标自定义图标
function createIcon(point){
	var icon=new LTIcon(iconUrl,[9,9],[4,4]);	
	var marker = new LTMarker(point ,icon);
	return marker;
}
//显示站点名称
function createMarker(point,txt){
	var icon=new LTIcon(iconUrl,[9,9],[0,30]);
	var marker=new LTMarker(point,icon);
	marker.setLabel('<div class="zhandian01"><div class="zhandian02">'+txt+'</div></div>');
	return marker;
}
//----------------------公交查询结束------------------------------------


//导航按钮
function daoHangFun(value,cellmeta,record,rowIndex,columnIndex,store)
{
	var str="<input type='button' value='导航' onclick='daoHangFunDo(\""+escape(record.data["id"])+"\",\""+escape(record.data["roadTitle"])+"\",\""+escape(record.data["lng"])+"\",\""+escape(record.data["lat"])+"\",\""+escape(record.data["roadDate"])+"\",\""+escape(record.data["roadTarget"])+"\",\""+escape(record.data["cityName"])+"\")'\>"
	//alert(str);
	return str;
}


var nav;	//导航对象
//var info;	//信息框对象
var points = [];	//导航关键点集合的经纬度
var startControl;	//起始标注点控件对象
var endControl;		//终点标注点控件对象
var startPoint = "";	//起始点坐标
var endPoint = "";		//终点坐标
var line;	//导航线路

//导航查询
function daoHangFunDo(id,roadTitle,lng,lat,roadDate,roadTarget,cityName)
{
	Ext.Ajax.request({
		url:'json_gongJiaoSearch.asp',
		method:'post',
		params:{
			roadTarget:roadTarget
		},
		success:function(req){
			//alert(req.responseText);
			maps.clearOverLays();
			var obj = req.responseText;
			
			if(obj.indexOf("|") != -1)
			{
				var objArr = obj.split("|");
				
				var slnglat = new LTPoint(parseInt(lng),parseInt(lat));
				startPoint = slnglat
				var elnglat = objArr[0].split(",");
				endPoint = new LTPoint(parseInt(elnglat[0]),parseInt(elnglat[1]));
				//alert(slnglat.getLongitude()+","+slnglat.getLatitude()+"|===|"+epoint.getLongitude()+","+epoint.getLatitude());
				
				//创建导航对象，run为接收返回值参数的函数
				nav = new LTNavigate(run);
				// 设置起点坐标 保存到导航对象中 
				nav.setFrom(startPoint);
				//设置终点坐标 
				nav.setTo(endPoint);
				//开始导航,默认为推荐线路
				nav.navigate(0);
				
				for(var i=0;i<objArr.length;i++)
				{
					if((i+1)<objArr.length)
					{
						var slnglat = objArr[i].split(",");
						var elnglat = objArr[i+1].split(",");
						startPoint = new LTPoint(slnglat[0],slnglat[1]);
						endPoint = new LTPoint(elnglat[0],elnglat[1]);
						//创建导航对象，run为接收返回值参数的函数
						nav = new LTNavigate(run);
						// 设置起点坐标 保存到导航对象中
						nav.setFrom(startPoint);
						//设置终点坐标 
						nav.setTo(endPoint);
						//开始导航,默认为推荐线路
						nav.navigate(0);
					}
				}
			}
			else
			{
				var elnglat = obj.split(",");
				startPoint = new LTPoint(lng,lat);
				endPoint = new LTPoint(elnglat[0],elnglat[1]);
				//创建导航对象，run为接收返回值参数的函数
				nav = new LTNavigate(run);
				// 设置起点坐标 保存到导航对象中
				nav.setFrom(startPoint);
				//设置终点坐标 
				nav.setTo(endPoint);
				//开始导航,默认为推荐线路
				nav.navigate(0);
			}
		}
	});
}

/*
*   接收导航返回值参数的函数，resultObj为导航返回的对象
*/
function run(resultObj){
	var obj = resultObj;
	//获得导航线路坐标集合
	var roads = obj.getRoadTrack();
	maps.removeOverLay(line);
	//创建画线对象
	var line = new LTPolyLine(roads);
	//向地图上添加线
	maps.addOverLay(line);
	//清空显示列表
	//document.getElementById("poisInfo").innerHTML="";
	//获得关键点描述对象
	var kpois = obj.getKeyPoints();
	for(var i=0;i<kpois.length;i++){
		//显示关键点描述内容
		createLine(kpois[i],i+1);
	}
}

/*
* 显示关键点描述内容，obj关键点对象，num为编号
*/
function createLine(obj,num){
	var o = obj;
	//判断概要信息中是否存在详细描述，如果存在显示详细描述
	if(obj.getExists()){
		//打开与关闭图标
		//toCenter(obj.getPoint(),obj.getDescription());
		var icon=new LTIcon(iconUrl,[9,9],[4,4]);
		var marker=new LTMarker(obj.getPoint(),icon);
		maps.addOverLay(marker);
		LTEvent.addListener(marker,"click",function(){
			//创建信息框对象
			var info = new LTInfoWindow();
			//设置信息框的经纬度
			info.setPoint(obj.getPoint());
			//设置信息框的内容简介
			info.setLabel(obj.getDescription());
			//将信息框添加到地图上
			maps.addOverLay(info);
		});
		points.push(obj.getPoint());
		
		//判断概要信息中是否存在详细描述，如果存在显示详细描述
		var kps = obj.getDetailedDescription();
		for(var i=0;i<kps.length;i++){
			(function(i){
				var lo = kps[i].lo; //经度
				var la = kps[i].la; //纬度
				var point = new LTPoint(lo,la);
				var des = kps[i].contentMerge;
				//toCenter(point,des);
				var icon=new LTIcon(iconUrl,[9,9],[4,4]);
				var marker=new LTMarker(point,icon);
				maps.addOverLay(marker);
				LTEvent.addListener(marker,"click",function(){
					//创建信息框对象
					var info = new LTInfoWindow();
					//设置信息框的经纬度
					info.setPoint(point);
					//设置信息框的内容简介
					info.setLabel(des);
					//将信息框添加到地图上
					maps.addOverLay(info);
				});
				points.push(point);
			})(i);
		}
		//document.getElementById("poisInfo").appendChild(div);
	}else{	//如果概要中没有详细信息，只显示概要信息
		//显示导航概要信息描述
		//toCenter(obj.getPoint(),obj.getDescription());
		var icon=new LTIcon(iconUrl,[9,9],[4,4]);
		var marker=new LTMarker(obj.getPoint(),icon);
		maps.addOverLay(marker);
		LTEvent.addListener(marker,"click",function(){
			//创建信息框对象
			var info = new LTInfoWindow();
			//设置信息框的经纬度
			info.setPoint(obj.getPoint());
			//设置信息框的内容简介
			info.setLabel(obj.getDescription());
			//将信息框添加到地图上
			maps.addOverLay(info);
		});
		points.push(obj.getPoint());
	}
	//将导航线路显示在地图内
	maps.getBestMap(points);
}

/*
* 将描述信息显示到地
*
**/
function toCenter(p,ifo){
	//显示到地图中心点
	//maps.moveToCenter(p);
	
	
	
	var icon=new LTIcon(iconUrl,[9,9],[4,4]);
	var marker=new LTMarker(p,icon);
	maps.addOverLay(marker);
	
	LTEvent.addListener(marker,"click",infoWindow);
	
	/*//创建信息框对象
	var info = new LTInfoWindow();
	//设置信息框的经纬度
	info.setPoint(p);
	//设置信息框的内容简介
	info.setLabel(ifo);
	//将信息框添加到地图上
	maps.addOverLay(info);*/
}

function infoWindow()
{
	
}

















//清除按钮
function shanChuFun(value,cellmeta,record,rowIndex,columnIndex,store)
{
	var str="<input type='button' value='清除' onclick='shanChuFunDo(\""+escape(record.data["id"])+"\",\""+escape(record.data["roadTitle"])+"\",\""+escape(record.data["lng"])+"\",\""+escape(record.data["lat"])+"\",\""+escape(record.data["roadDate"])+"\",\""+escape(record.data["roadTarget"])+"\",\""+escape(record.data["cityName"])+"\")'\>"
	//alert(str);
	return str;
}

//清除
function shanChuFunDo(id,roadTitle,lng,lat,roadDate,roadTarget)
{
	
}
//-----------------------------------------行程信息查询结束----------------------------------------

function indexOfStr(val,text){
	for(var i = 0; i < val.length; i++)
	{
		if(val[i] == text)return i;
	}
	return -1;
}

function removeStr(val,text){
	var index = indexOfStr(val,text);
	if (index > -1) {
		val.splice(index, 1);
	}
}

var imgDefaultWidth = 210;
var imgDefaultHeight = 160;
var imgDefaultWidthZoomIn = 250;
var imgDefaultHeightZoomOut = 200;
function imgZoomIn(self)
{
	self.style.width=imgDefaultWidthZoomIn;
	self.style.height=imgDefaultHeightZoomOut;
	self.style.position="relative";
	self.style.left = (-(imgDefaultWidthZoomIn-imgDefaultWidth)/2)+"px";
	self.style.top = (-(imgDefaultHeightZoomOut-imgDefaultHeight)/2)+"px";
	self.style.zIndex = 1;
}

function imgZoomOut(self)
{
	self.style.width=imgDefaultWidth;
	self.style.height=imgDefaultHeight;
	self.style.left = "0px";
	self.style.top = "0px";
}

function loginOut()
{
	Ext.Ajax.request({
		url:'loginout.asp',
		method:'get',
		params:{
			uid:'uid'
		},
		success:function(req){
			//alert(req.responseText);
			//window.close();
			location.href="login.asp";
			/*if(req.responseText=='ok')
			{
				Ext.Msg.alert('success','You got it!');
			}
			else
			{
				Ext.Msg.alert('sorry','You lost!');
			}*/
		}
	});
}

function loginAdmin()
{
	location.href="admin.asp";
}

function obj2str(o){
	var r = [];
	if(typeof o =="string") return "\""+o.replace(/([\'\"\\])/g,"\\$1").replace(/(\n)/g,"\\n").replace(/(\r)/g,"\\r").replace(/(\t)/g,"\\t")+"\"";
	if(typeof o =="undefined") return "";
	if(typeof o == "object"){
		if(o===null) return "null";
		else if(!o.sort){
			for(var i in o)
				r.push(i+":"+obj2str(o[i]))
			r="{"+r.join()+"}"
		}else{
			for(var i =0;i<o.length;i++)
				r.push(obj2str(o[i]))
			r="["+r.join()+"]"
		}
		return r;
	}
	return o.toString();
}
</script>
<style type="text/css">
<!--
.style1 {
	font-size: 14px;
	font-weight: bold;
}
-->
body{
text-align:left;
}
        </style>
</head>
<body>
<!--<div id="north-div">
  <div class="style1" id="menu">网点查询系统</div>
</div>-->
<div id="north-div" style="background-image:url(images/bg_head.jpg)"><img src="images/logoTop.jpg">
  <div class="style1" style="display:none" id="menu">网点查询系统</div>
  <!--<div style="cursor:pointer" onClick="loginOut();">
  	<div style="position:absolute; right:80; top:15;font-size:12px; background-image:url(images/exit.jpg); width:20px; height:18px"></div><div style="position:absolute; right:30; top:15;font-size:12px">退出系统</div>
  </div>
  <div style="cursor:pointer" onClick="loginAdmin();">
  	<div style="position:absolute; right:200; top:15;font-size:12px; background-image:url(images/admin.jpg); width:20px; height:20px"></div>
	<div style="position:absolute; right:125; top:15;font-size:12px">登录管理页面</div>
  </div>-->
</div>
<!--<div id="treeCitysSearch"></div>-->
<div id="treeSaleAreaSearchDiv"></div>
<div id="myMap" style="position:relative; width:100%; height:100%;border:black solid 0px;"></div>
<div id="south-div" style="font-size:12px;"><%=CC_CopyRight%></div>
<div id="tree-panel"></div>
</body>
</html>
